<?php
if ($_FILES["test_file"]["error"] > 0)
  {
  echo "Error: " . $_FILES["test_file"]["error"] . "<br />";
  }
else
  {
  echo "Upload: " . $_FILES["test_file"]["name"] . "<br />";
  echo "Type: " . $_FILES["test_file"]["type"] . "<br />";
  echo "Size: " . ($_FILES["test_file"]["size"] / 1024) . " Kb<br />";
  echo "Stored in: " . $_FILES["test_file"]["tmp_name"];
  if (file_exists("upload/" . $_FILES["test_file"]["name"]))
        {
        echo $_FILES["test_file"]["name"] . " already exists. ";
        }
      else
        {
        move_uploaded_file($_FILES["test_file"]["tmp_name"],
        "upload/" . $_FILES["test_file"]["name"]);
        echo "Stored in: " . "upload/" . $_FILES["test_file"]["name"];
        }
  }
?>